<template>
  <div class="common-layout">
    <el-container>
      <el-aside width="200px" style="width: auto">
        <!-- <div class="title textColor">
        </div> -->
        <el-menu
          default-active="2"
          class="el-menu-vertical-demo"
          :collapse="isCollapse"
        >
          <!-- :collapse="true" -->
          <!-- @open="handleOpen"
        @close="handleClose" -->
          <div class="title">
            <a
              href="/"
              style="
                width: 100%;
                display: flex;
                justify-content: center;
                text-decoration: none;
              "
            >
              <div style="width: 37px; height: 37px">
                <el-image
                  style="width: 30px; height: 30px; margin: 4px auto"
                  :src="url"
                />
              </div>
              <h1 v-if="!isCollapse" class="textColor">TCAdmin</h1>
            </a>
          </div>
          <el-menu-item index="2">
            <el-icon><Expand /></el-icon>
            <span>Navigator Two</span>
          </el-menu-item>
        </el-menu>
      </el-aside>
      <el-container>
        <el-header
          ><div class="collIcon">
            <el-icon
              v-if="!isCollapse"
              @click="() => (isCollapse = true)"
              color="#439efd"
              ><Fold
            /></el-icon>
            <el-icon v-else @click="() => (isCollapse = false)" color="#439efd"
              ><Expand
            /></el-icon></div
        ></el-header>
        <el-main>Main</el-main>
      </el-container>
    </el-container>
  </div>
</template>

<script setup lang="ts">
import { ref } from "vue";

const isCollapse = ref<boolean>(false);
const url =
  "https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg";
</script>

<style lang="scss" scoped>
.title {
  font-weight: bold;
  height: 40px;
  line-height: 40px;
  background-color: #fcfcfc;
  border-bottom: 1px solid #439efd;
}
.el-aside {
  .el-menu {
    border-radius: 3px;
    height: calc(100vh);
  }
}
.textColor {
  color: #439efd;
}
.collIcon {
}
.collIcon:hover {
  cursor: pointer;
  cursor: hand;
}
</style>
